using System;
using System.Collections.Generic;
using System.Text;

using Schemata.Core;
using NUnit.Framework;

namespace Schemata.Core.Tests
{
    [TestFixture]
    public class DatabaseSchemaFixture
    {
        [Test]
        public void VerifyTables()
        {
            SqlServerSchemaProvider provider = new SqlServerSchemaProvider();

            // Note: Connection string must specify oledb provider.
            string connectionString = "Provider=sqloledb;Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI;";
            DatabaseSchema database = new DatabaseSchema("Northwind",provider,connectionString);

            foreach (TableSchema table in database.Tables)
            {
                Console.WriteLine(table.Name);
            }

            Assert.AreEqual("Northwind", database.Name);
            Assert.AreEqual(13, database.Tables.Count);            
        }
    }
}
